<script type='text/javascript' src='{$base_dir}modules/dept_rad/js/AJAX_RadQueue.js'></script>
<script src='{$base_dir}js/jquery.contextmenu.r2.packed.js' type='text/javascript' ></script>
<script type='text/javascript'>
{literal}   
$(document).ready(function() {
    $('#reloadRadQueue').bind('click', function() {
        loadRadQueue();
    });

    $('select#patientType').bind('change', function() {
        loadRadQueue();
    });
    
    $('select#radRoomId').bind('change', function() {
        loadRadQueue();
    });
    
	loadRadQueue();
});
{/literal}
</script>

<div id='rabQueueDiv'>
    <table cellpadding='0' cellspacing='0'>
        <tr>
            <td style='padding-right: 20px; text-transform: uppercase;'>
                <span class='label' style='font-weight: bold;'>{translate}Room{/translate}&nbsp;&nbsp;</span>&nbsp;
                <select id='radRoomId' name='radRoomId' style='width: 200px;'>
                    {html_options options=$roomList selected=$defaultRoom}
                </select>
            </td>
            <td style='padding-right: 10px; text-transform: uppercase;'>
                <span class='label' style='font-weight: bold;'>{translate}Patient{/translate} &nbsp;&nbsp;</span>
                <select id='patientType' style='width: 200px;'>  
                	{html_options options=$patientType selected=$defaultType};                  
                </select>
            </td>
            <td>
                <div id='radQueueActionDiv' style='display: block;'>
                    <a style='cursor: pointer' id='reloadRadQueue' title='{translate}Update list of patients{/translate}'><img src='{$base_uri}/images/refresh.png'/></a>                      
                </div>
                <div id='radQueueLoaderDiv' style='display: none;'>
                    <img src='{$base_uri}/images/ajax-loader.gif'/>
                </div>
            </td>
        </tr>
    </table>
    
    <div id='waitingQueueDiv' class='queue'>
        <div class='documentListHeader'>
            <span>{translate}List of patients wait for examination{/translate} </span>
        </div>
        <table id='waitingQueueTbl' cellspacing='0' cellpadding='0' class='grid' style='width: 100%'>                       
            <thead>
                <tr>
                    <th>{translate}Order number{/translate}</th>
                    <th>{translate}Patient_1{/translate}</th>
                    <th>{translate}Patient's ID_1{/translate}</th>                              
                    <th>{translate}Assignment{/translate}</th>
                    <th>{translate}Dept. check-in{/translate}</th>
                    <th>{translate}Waiting time_1{/translate}</th>                                                                
                    <th>{translate}From dept{/translate}</th>                            
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    
    <div id='inProgressQueueDiv' class='queue'>
        <div class='documentListHeader'>
            <span> {translate}Patients are examining{/translate} </span>
        </div>
        <table id='inProgressQueueTbl' cellspacing='0' cellpadding='0' class='grid' style='width: 100%'>                        
            <thead>
                <tr>
                    <th>{translate}Order number{/translate}</th>
                    <th>{translate}Patient_1{/translate}</th>
                    <th>{translate}Patient's ID_1{/translate}</th>                              
                    <th>{translate}Assignment{/translate}</th>
                    <th>{translate}RadQueue_Start_Time{/translate}</th>
                    <th>{translate}From dept{/translate}</th>
                    <th>&nbsp;</th>                                                                     
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
</div>    